﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@

<!-- 网页的主体内容-->
<!--   -->
<div class="container d-flex justify-content-center" style="margin-top:200px">
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover table-sm">
            <thead class="thead-dark">
                <tr class="text-center">
                    <th>编号</th>
                    <th>菜系</th>
                    <th>菜名</th>
                    <th>凉/热菜</th>
                    <th>添加日期</th>
                    <th>作者</th>
                    <th>备注</th>
                    <th>查询</th>
                    <th>删除</th>
                </tr>
            </thead>
            <tbody>
                @foreach (Recipe recipe in ViewBag.Recipes)
                {
                <tr class="text-center" style="height:50px">
                    <td><a href="~/home/detail/@recipe.Code">@recipe.Code</a></td>
                    <td>@recipe.Cai_xi</td>
                    <td>@recipe.Cai_name</td>
                    @if (recipe.Cai_wen)
                    {
                        <td>热菜</td>
                    }
                    else
                    {
                        <td>凉菜</td>
                    }

                    <td>@recipe.Add_date</td>
                    <td>@recipe.Zuo_zhe</td>
                    <td>@recipe.Bei_zhu</td>
                    <td><a href="~/home/edit/@recipe.Id">编辑</a></td>
                    <td><a href="~/home/Delete/@recipe.Id">删除</a></td>
                </tr>
                }
            </tbody>

        </table>
    </div>
</div>